package com.mdd.front.validate.specification;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 服务规格参数
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class GoodsSpecificationParam implements Serializable {

    private static final long serialVersionUID = 1L;

    public interface create{}
    public interface update{}
    public interface delete{}

    //@IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Long id;

    @NotNull(message = "goodsId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "goodsId参数值不能少于0", groups = {create.class, update.class})
    private Long goodsId;

    @NotNull(message = "goodsName参数缺失", groups = {create.class, update.class})
    @Length(max = 100, message = "goodsName参数不能超出100个字符", groups = {create.class, update.class})
    private String goodsName;

    @NotNull(message = "name参数缺失", groups = {create.class, update.class})
    @Length(max = 100, message = "name参数不能超出100个字符", groups = {create.class, update.class})
    private String name;

    @NotNull(message = "price参数缺失", groups = {create.class, update.class})
    private BigDecimal price;

    //@NotNull(message = "incrementPrice参数缺失", groups = {create.class, update.class})
    private BigDecimal incrementPrice;

    //优惠价格的数量
    private String preferentialQuantity;

    //@NotNull(message = "createdBy参数缺失", groups = {create.class, update.class})
    //@DecimalMin(value = "0", message = "createdBy参数值不能少于0", groups = {create.class, update.class})
    private Long createdBy;

    //@NotNull(message = "updatedBy参数缺失", groups = {create.class, update.class})
    //@DecimalMin(value = "0", message = "updatedBy参数值不能少于0", groups = {create.class, update.class})
    private Long updatedBy;

    //@NotNull(message = "remark参数缺失", groups = {create.class, update.class})
    //@Length(max = 255, message = "remark参数不能超出255个字符", groups = {create.class, update.class})
    private String remark;

}
